<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<link rel="stylesheet" href="{$patch}sfdp.5.0.css?v=5.0.1" />
<body><div class="sfdp-top">Sfdp超级表单开发平台 v6.0</div>
<div>
    <div id="ctlMenus" class="sfdp-con" style="float: left; width: 240px;">
        <div class="sfdp-tool-title">设计控制区 Design control area</div>
        &#8194;&#8194;
        <div class="button" onclick='sfdp.sys_config()'>配置</div><div class="button" id='up_save'>保存</div><div onclick='window.location.reload()' class="button">刷新</div><div class="button" onClick="sfdp.openfullpage('官网','//cojz8.com')">帮助</div>
        <div class="sfdp-cl" ></div>
        <div class="sfdp-tool-title sfdp-mt10">页面布局 Form control library</div>
        <div class='sfdp-tool-fix'onclick='sfdp.build_bj()'><a>&#8194;<b class='ico'>↭</b>&#8194;栅格布局 </a></div>
        <div class="sfdp-cl"></div>
        <div class="sfdp-tool-title sfdp-mt10">表单控件库 Form control library</div>
        <div class="sfdp-tool-con" ><a data="text">&#8194;<b class='ico'>Α</b>&#8194;文本</a></div>
        <div class="sfdp-tool-con" ><a data="number">&#8194;<b class='ico'>½</b>&#8194;数字</a></div>
        <div class="sfdp-tool-con"><a data="dropdown">&#8194;<b class='ico'>≡</b>&#8194;下拉组件 </a></div>
        <div class="sfdp-tool-con"><a data="date">&#8194;<b class='ico'>◑</b>&#8194;日期时间</a></div>
        <div class="sfdp-cl"></div>
        <div style="padding: 10px;font-size: 15px;">
            <b>使用帮助：</b>列表式表单，生成类似Excel表单，能方便用户快速录入数据;<br>
            <b>①、</b>构建助手会生成一行填写框，用于录入数据;<br>
        </div>
    </div>
    <div class="sfdp-con" style="float: left; width: calc(100% - 600px);">
        <div id="sfdp-main"></div>
    </div>
    <div class="sfdp-con" style="float: right; width: 360px;">
        <div class="sfdp-att">
            <br/><br/><div style="padding: 24px 48px;"> <h1>\ (•◡•) / </h1><p> Sfdp V6.0正式版<br/><span style="font-size:19px;">超级表单开发</span></p><span style="font-size:15px;">[ © Guoguo <a href="https://www.cojz8.com/">Sfdp</a> 版权禁删！ ]</span></div>
        </div>
    </div>
    <div class="sfdp-cl"></div>
</div>
<script src="{$patch}lib/jquery-3.4.1.min.js"></script>
<script src="{$patch}lib/layer/3.1.1/layer.js"></script>
<script src="{$patch}lib/pingyin.js"></script>
<script type="text/javascript" src="{$patch}sfdp.5.0.js?v=5.0.322222"></script>
<script type="text/javascript" src="{$patch}sfdp.config.js?v=5.0.322222"></script>
<script type="text/javascript" src="{$patch}lib/jquery-ui.js"></script>
<script type="text/javascript" language="javascript">
    var look_db = {$look};
    var s_type = 0;
    const server_url ='{$save}';
    $(function(){
        sfdp.int_data({$json|raw});
    });
    $( ".sfdp-tool-con" ).draggable({
        connectToSortable: ".fb-fz",
        helper: "clone",
        revert: "invalid",
        cursor: "move"
    });
    $( "#sfdp-main" ).sortable({
        stop: function( event, ui ) {
            let obj = {}
            let obj2 = []
            const json_data = JSON.parse(localStorage.getItem("json_data"));
            const sortedList = $("#sfdp-main div.sfdp-rows ")
            for(let i= 0; i< sortedList.length ;i++){
                let item = sortedList[i]
                //删除TR数据
                sfdp.dataSave('', item.id , 'tr_del');
                //重新写入数据库
                sfdp.dataSave(json_data.list[item.id], String(item.id), 'tr')
            }
        }
    });
    $( "#sfdp-main" ).disableSelection();

    $( "#fb-fz" ).sortable({
        cancel: ".fb-disabled"
    });

    $(document).on("input propertychange", "#tpfd_name", function (e) {
        $("#tpfd_db").val($("#tpfd_name").toPinyin().toLowerCase());
    });
    $("#up_save").click(function(){
        var int_data = localStorage.getItem("json_data");
        var id='{$fid}';
        $.ajax({
            url:'{$save}',
            data:{ziduan:int_data,id:id},
            type:'post',
            cache:true,
            dataType:'json',
            success:function(data) {
                if(data.code==0){
                    sfdp.ShowTip('success');
                }else{
                    sfdp.ShowTip(data.msg);
                }
            }
        });
    })
</script>